import request from '@/utils/request'

// 确认是否收藏当前新闻
export const collectIs = ({ newsId }) => {
  return request.post(
    '/collect/isCollected',
    { newsId },
    {
      headers: { 'Content-Type': 'application/json' }
    }
  )
}

// 添加收藏
export const collectAdd = ({ newsId }) => {
  return request.post(
    '/collect/add',
    { newsId },
    {
      headers: { 'Content-Type': 'application/json' }
    }
  )
}

// 取消收藏
export const collectDelete = ({ newsId }) => {
  return request.post(
    '/collect/delete',
    { newsId },
    {
      headers: { 'Content-Type': 'application/json' }
    }
  )
}
//获取当前收藏的新闻
export const collectionList = (pages,size) => {
    return request.get('/news/collectList?pages='+pages+'&size='+size)
}
